package com.zhao.test.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author xiaoZhao
 * @date 2022/10/14
 * @describe
 */
public class ExcelListener extends AnalysisEventListener<DemoDate> {

    // 一行一行读取内容
    @Override
    public void invoke(DemoDate data, AnalysisContext context) {
        System.out.println("***"+data);
    }

    // 读取表头内容
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头："+headMap);
    }

    // 读取完成后执行操作
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
